import request from '@/utils/request.js'

/**
 * 获取当前登录用户的购物车列表
 * @returns 
 */
export const cartListApi = () => {
	return request.get('cart/list')
}
/**
 *  删除购物车商品
 * @param {*} id 删除商品Id
 * @returns 
 */
export const delCartApi = (id) => {
	return request.post('/cart/clear', {
		cartIds: [id],
	})
}
/**
 * 修改购物车商品数量
 * @param {*} goodsId 
 * @param {*} goodsNum 
 * @returns 
 */
export const cartUpdateApi = (goodsId, goodsNum) => {
	return request.post('/cart/update', {
		goodsId,
		goodsSkuId: "0",
		goodsNum
	})
}